<cfcomponent hint="I return information about the application" output="false">

	<cffunction name="init" output="false" returntype="any" hint="instantiates an object of this class" access="public">
		
		<cfreturn this />			
	</cffunction>
	
	<cffunction name="getApplicationSessionCount" returntype="numeric" output="false">
		<cfargument name="applicationname" type="string" required="true">	   
		<cfscript>
			try {
				var oSession = createObject("java","coldfusion.runtime.SessionTracker");
				var mySessions= oSession.getSessionCollection(arguments.applicationname);
				return StructCount(mySessions);
			}
			catch (any e) {
				try {		
					return structcount(application.sessions);
				}
				catch (any e) {
					return 0;
				}
			}
		</cfscript>	   
	</cffunction>


</cfcomponent>